Integrand size = 28, antiderivative size = 121 \[ \int \frac {1}{\sqrt {a+a \sec (e+f x)} (c-c \sec (e+f x))} \, dx=\frac {2 \arctan \left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{\sqrt {a} c f}-\frac {\arctan \left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {2} \sqrt {a+a \sec (e+f x)}}\right )}{\sqrt {2} \sqrt {a} c f}+\frac {\cot (e+f x) \sqrt {a+a \sec (e+f x)}}{a c f} \]
[Out]
Time = 0.23 (sec) , antiderivative size = 121, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.179, Rules used = {3989, 3972, 491, 536, 209} \[ \int \frac {1}{\sqrt {a+a \sec (e+f x)} (c-c \sec (e+f x))} \, dx=\frac {2 \arctan \left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {a \sec (e+f x)+a}}\right )}{\sqrt {a} c f}-\frac {\arctan \left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {2} \sqrt {a \sec (e+f x)+a}}\right )}{\sqrt {2} \sqrt {a} c f}+\frac {\cot (e+f x) \sqrt {a \sec (e+f x)+a}}{a c f} \]
[In]
[Out]
Rule 209
Rule 491
Rule 536
Rule 3972
Rule 3989
Rubi steps \begin{align*} \text {integral}& = -\frac {\int \cot ^2(e+f x) \sqrt {a+a \sec (e+f x)} \, dx}{a c} \\ & = \frac {2 \text {Subst}\left (\int \frac {1}{x^2 \left (1+a x^2\right ) \left (2+a x^2\right )} \, dx,x,-\frac {\tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{a c f} \\ & = \frac {\cot (e+f x) \sqrt {a+a \sec (e+f x)}}{a c f}+\frac {\text {Subst}\left (\int \frac {-3 a-a^2 x^2}{\left (1+a x^2\right ) \left (2+a x^2\right )} \, dx,x,-\frac {\tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{a c f} \\ & = \frac {\cot (e+f x) \sqrt {a+a \sec (e+f x)}}{a c f}+\frac {\text {Subst}\left (\int \frac {1}{2+a x^2} \, dx,x,-\frac {\tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{c f}-\frac {2 \text {Subst}\left (\int \frac {1}{1+a x^2} \, dx,x,-\frac {\tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{c f} \\ & = \frac {2 \arctan \left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{\sqrt {a} c f}-\frac {\arctan \left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {2} \sqrt {a+a \sec (e+f x)}}\right )}{\sqrt {2} \sqrt {a} c f}+\frac {\cot (e+f x) \sqrt {a+a \sec (e+f x)}}{a c f} \\ \end{align*}
Result contains higher order function than in optimal. Order 5 vs. order 3 in optimal.
Time = 0.43 (sec) , antiderivative size = 75, normalized size of antiderivative = 0.62 \[ \int \frac {1}{\sqrt {a+a \sec (e+f x)} (c-c \sec (e+f x))} \, dx=-\frac {\cot \left (\frac {1}{2} (e+f x)\right ) \left (\operatorname {Hypergeometric2F1}\left (-\frac {1}{2},1,\frac {1}{2},\frac {1}{2} (1-\sec (e+f x))\right )-2 \operatorname {Hypergeometric2F1}\left (-\frac {1}{2},1,\frac {1}{2},1-\sec (e+f x)\right )\right )}{c f \sqrt {a (1+\sec (e+f x))}} \]
[In]
[Out]
Time = 2.48 (sec) , antiderivative size = 167, normalized size of antiderivative = 1.38
method | result | size |
default | \(-\frac {\sqrt {a \left (\sec \left (f x +e \right )+1\right )}\, \left (\sqrt {2}\, \sqrt {-\frac {\cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}\, \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )+\sqrt {\cot \left (f x +e \right )^{2}-2 \csc \left (f x +e \right ) \cot \left (f x +e \right )+\csc \left (f x +e \right )^{2}-1}\right )-4 \,\operatorname {arctanh}\left (\frac {\sin \left (f x +e \right )}{\left (\cos \left (f x +e \right )+1\right ) \sqrt {-\frac {\cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}}\right ) \sqrt {-\frac {\cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}-2 \cot \left (f x +e \right )\right )}{2 c f a}\) | \(167\) |
[In]
[Out]
none
Time = 0.35 (sec) , antiderivative size = 436, normalized size of antiderivative = 3.60 \[ \int \frac {1}{\sqrt {a+a \sec (e+f x)} (c-c \sec (e+f x))} \, dx=\left [\frac {\sqrt {2} a \sqrt {-\frac {1}{a}} \log \left (\frac {2 \, \sqrt {2} \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \sqrt {-\frac {1}{a}} \cos \left (f x + e\right ) \sin \left (f x + e\right ) + 3 \, \cos \left (f x + e\right )^{2} + 2 \, \cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right )^{2} + 2 \, \cos \left (f x + e\right ) + 1}\right ) \sin \left (f x + e\right ) - 2 \, \sqrt {-a} \log \left (-\frac {8 \, a \cos \left (f x + e\right )^{3} + 4 \, {\left (2 \, \cos \left (f x + e\right )^{2} - \cos \left (f x + e\right )\right )} \sqrt {-a} \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \sin \left (f x + e\right ) - 7 \, a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right ) + 1}\right ) \sin \left (f x + e\right ) + 4 \, \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \cos \left (f x + e\right )}{4 \, a c f \sin \left (f x + e\right )}, \frac {\sqrt {2} \sqrt {a} \arctan \left (\frac {\sqrt {2} \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \cos \left (f x + e\right )}{\sqrt {a} \sin \left (f x + e\right )}\right ) \sin \left (f x + e\right ) + 2 \, \sqrt {a} \arctan \left (\frac {2 \, \sqrt {a} \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \cos \left (f x + e\right ) \sin \left (f x + e\right )}{2 \, a \cos \left (f x + e\right )^{2} + a \cos \left (f x + e\right ) - a}\right ) \sin \left (f x + e\right ) + 2 \, \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \cos \left (f x + e\right )}{2 \, a c f \sin \left (f x + e\right )}\right ] \]
[In]
[Out]
\[ \int \frac {1}{\sqrt {a+a \sec (e+f x)} (c-c \sec (e+f x))} \, dx=- \frac {\int \frac {1}{\sqrt {a \sec {\left (e + f x \right )} + a} \sec {\left (e + f x \right )} - \sqrt {a \sec {\left (e + f x \right )} + a}}\, dx}{c} \]
[In]
[Out]
\[ \int \frac {1}{\sqrt {a+a \sec (e+f x)} (c-c \sec (e+f x))} \, dx=\int { -\frac {1}{\sqrt {a \sec \left (f x + e\right ) + a} {\left (c \sec \left (f x + e\right ) - c\right )}} \,d x } \]
[In]
[Out]
Exception generated. \[ \int \frac {1}{\sqrt {a+a \sec (e+f x)} (c-c \sec (e+f x))} \, dx=\text {Exception raised: TypeError} \]
[In]
[Out]
Timed out. \[ \int \frac {1}{\sqrt {a+a \sec (e+f x)} (c-c \sec (e+f x))} \, dx=\int \frac {1}{\sqrt {a+\frac {a}{\cos \left (e+f\,x\right )}}\,\left (c-\frac {c}{\cos \left (e+f\,x\right )}\right )} \,d x \]
[In]
[Out]